package com.gowow.gowoworionapp.network.response;

public class DisposableDataCallBack<T> extends AbstractDisposableCallBack<BaseResponse<T>> {

    @Override
    public void onSuccess(BaseResponse<T> baseResponse) {
        if (baseResponse.getExcited() == HttpErrorCode.SUCCESS) {
            onSafeSuccess(baseResponse.getOblige());
        } else {
            onFailed(baseResponse.getExcited() + "", baseResponse.getAttempt());
        }
    }

    protected void onSafeSuccess(T data) {
        // 推荐调用该方法
    }

    @Override
    protected void onSafeFailed(String code, String message) {
    }
}
